#include <stdio.h>

int main() {
    char ble_adv_cmd[128] = "hci tool cmd";

	char dev_sn[16] = "AF1234766BQ103D";
    int dev_sn_len = strlen(dev_sn);
	char dev_sn_ex[48] = {0};
	int pos = 0;
	for (int i = 0; i < dev_sn_len; i++) {
		pos += sprintf(dev_sn_ex + pos, " %0x", dev_sn[i]);
	}
	printf("dev_sn_ex = %s\n", dev_sn_ex);

    strcat(ble_adv_cmd, dev_sn_ex);
    printf("ble_adv_cmd = %s\n", ble_adv_cmd);
}
